package 里氏替换原则;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassNameMain
 * @Description
 * @Author
 * @Date2021/11/11 20:10
 **/
public class Main {
    public static void main(String[] args) {
        /*Bird swallow = new Swallow();
        swallow.setFlySpeed(120);
        double flyTime = swallow.getFlyTime(300);

        Animal brownKiwi = new BrownKiwi();
        brownKiwi.setRunSpeed(50);
        double runTime = brownKiwi.getRunTime(300);

        System.out.println("燕子飞行时间：" + flyTime);
        System.out.println("几维鸟跑步时间：" + runTime);*/

        Rectangle rectangle = new Rectangle();
        rectangle.setWidth(20);
        rectangle.setHeight(10);
        resize(rectangle);
        List<Object> objects = new ArrayList<>();

        /*Square square = new Square();
        square.setLength(10);
        resize(square);*/

    }

    public static void resize(Rectangle rectangle) {
        while (rectangle.getWidth() >= rectangle.getHeight()) {
            rectangle.setHeight(rectangle.getHeight() + 1);
            System.out.println("width: " + rectangle.getWidth() +
                    ",Height: " + rectangle.getHeight());
        }
        System.out.println("Resize End,width:" + rectangle.getWidth() +
                " ,Height:" + rectangle.getHeight());
    }
}
